namespace PMS.BLL
{
    using PMS.DBUtility;
    using PMS.Model;
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Data.SqlClient;
    using System.Text;

    public class OrganConfigBLL
    {
        public int Add(OrganConfig model)
        {
            StringBuilder builder = new StringBuilder();
            builder.Append("insert into OrganConfig(");
            builder.Append("FKJ_Count,ZGJ_Count,FGJ_Count,XSY_Count,FXSY_Count,DYY_Count,FDYY_Count,ZRKY_Count,FZRKY_Count,KY_Count,OrganID,BSY_Count,BDJ_Count,IsOffice,Manager_Count,M_3,M_4,M_5,M_6,M_7,M_8,UserBuild_Count,M_9,M_10,Skiller_Count,S_1,S_2,S_3,S_4,S_5,S_6,S_7,UserJobPostion_Count,S_8,S_9,S_10,S_11,S_12,S_13,Worker_Count,W_0,W_1,W_2,ZTJ_Count,W_3,W_4,W_5,IsDoublePosition_Count,No,Remark,FTJ_Count,ZXJ_Count,FXJ_Count,ZKJ_Count");
            builder.Append(") values (");
            builder.Append("@FKJ_Count,@ZGJ_Count,@FGJ_Count,@XSY_Count,@FXSY_Count,@DYY_Count,@FDYY_Count,@ZRKY_Count,@FZRKY_Count,@KY_Count,@OrganID,@BSY_Count,@BDJ_Count,@IsOffice,@Manager_Count,@M_3,@M_4,@M_5,@M_6,@M_7,@M_8,@UserBuild_Count,@M_9,@M_10,@Skiller_Count,@S_1,@S_2,@S_3,@S_4,@S_5,@S_6,@S_7,@UserJobPostion_Count,@S_8,@S_9,@S_10,@S_11,@S_12,@S_13,@Worker_Count,@W_0,@W_1,@W_2,@ZTJ_Count,@W_3,@W_4,@W_5,@IsDoublePosition_Count,@No,@Remark,@FTJ_Count,@ZXJ_Count,@FXJ_Count,@ZKJ_Count");
            builder.Append(") ");
            builder.Append(";select @@IDENTITY");
            SqlParameter[] cmdParms = new SqlParameter[] { 
                new SqlParameter("@FKJ_Count", model.FKJ_Count), new SqlParameter("@ZGJ_Count", model.ZGJ_Count), new SqlParameter("@FGJ_Count", model.FGJ_Count), new SqlParameter("@XSY_Count", model.XSY_Count), new SqlParameter("@FXSY_Count", model.FXSY_Count), new SqlParameter("@DYY_Count", model.DYY_Count), new SqlParameter("@FDYY_Count", model.FDYY_Count), new SqlParameter("@ZRKY_Count", model.ZRKY_Count), new SqlParameter("@FZRKY_Count", model.FZRKY_Count), new SqlParameter("@KY_Count", model.KY_Count), new SqlParameter("@OrganID", model.OrganID), new SqlParameter("@BSY_Count", model.BSY_Count), new SqlParameter("@BDJ_Count", model.BDJ_Count), new SqlParameter("@IsOffice", model.IsOffice), new SqlParameter("@Manager_Count", model.Manager_Count), new SqlParameter("@M_3", model.M_3), 
                new SqlParameter("@M_4", model.M_4), new SqlParameter("@M_5", model.M_5), new SqlParameter("@M_6", model.M_6), new SqlParameter("@M_7", model.M_7), new SqlParameter("@M_8", model.M_8), new SqlParameter("@UserBuild_Count", model.UserBuild_Count), new SqlParameter("@M_9", model.M_9), new SqlParameter("@M_10", model.M_10), new SqlParameter("@Skiller_Count", model.Skiller_Count), new SqlParameter("@S_1", model.S_1), new SqlParameter("@S_2", model.S_2), new SqlParameter("@S_3", model.S_3), new SqlParameter("@S_4", model.S_4), new SqlParameter("@S_5", model.S_5), new SqlParameter("@S_6", model.S_6), new SqlParameter("@S_7", model.S_7), 
                new SqlParameter("@UserJobPostion_Count", model.UserJobPostion_Count), new SqlParameter("@S_8", model.S_8), new SqlParameter("@S_9", model.S_9), new SqlParameter("@S_10", model.S_10), new SqlParameter("@S_11", model.S_11), new SqlParameter("@S_12", model.S_12), new SqlParameter("@S_13", model.S_13), new SqlParameter("@Worker_Count", model.Worker_Count), new SqlParameter("@W_0", model.W_0), new SqlParameter("@W_1", model.W_1), new SqlParameter("@W_2", model.W_2), new SqlParameter("@ZTJ_Count", model.ZTJ_Count), new SqlParameter("@W_3", model.W_3), new SqlParameter("@W_4", model.W_4), new SqlParameter("@W_5", model.W_5), new SqlParameter("@IsDoublePosition_Count", model.IsDoublePosition_Count), 
                new SqlParameter("@No", model.No), new SqlParameter("@Remark", model.Remark), new SqlParameter("@FTJ_Count", model.FTJ_Count), new SqlParameter("@ZXJ_Count", model.ZXJ_Count), new SqlParameter("@FXJ_Count", model.FXJ_Count), new SqlParameter("@ZKJ_Count", model.ZKJ_Count)
             };
            object single = DBHelper.GetSingle(builder.ToString(), cmdParms);
            if (single == null)
            {
                return 0;
            }
            return Convert.ToInt32(single);
        }

        public bool Delete(int ConfigID)
        {
            StringBuilder builder = new StringBuilder();
            builder.Append("delete from OrganConfig ");
            builder.Append(" where ConfigID=@ConfigID");
            SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@ConfigID", SqlDbType.Int, 4) };
            cmdParms[0].Value = ConfigID;
            return (DBHelper.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }

        public bool DeleteList(string ConfigIDlist)
        {
            StringBuilder builder = new StringBuilder();
            builder.Append("delete from OrganConfig ");
            builder.Append(" where ID in (" + ConfigIDlist + ")  ");
            return (DBHelper.ExecuteSql(builder.ToString()) > 0);
        }

        public List<OrganConfig> GetList()
        {
            StringBuilder builder = new StringBuilder();
            builder.Append("select * ");
            builder.Append(" FROM OrganConfig ");
            DataTable table = DBHelper.Query(builder.ToString()).Tables[0];
            OrganConfig item = null;
            List<OrganConfig> list = null;
            if (table.Rows.Count > 0)
            {
                list = new List<OrganConfig>();
                foreach (DataRow row in table.Rows)
                {
                    item = new OrganConfig();
                    if (row["ConfigID"].ToString() != "")
                    {
                        item.ConfigID = int.Parse(row["ConfigID"].ToString());
                    }
                    if (row["FKJ_Count"].ToString() != "")
                    {
                        item.FKJ_Count = int.Parse(row["FKJ_Count"].ToString());
                    }
                    if (row["ZGJ_Count"].ToString() != "")
                    {
                        item.ZGJ_Count = int.Parse(row["ZGJ_Count"].ToString());
                    }
                    if (row["FGJ_Count"].ToString() != "")
                    {
                        item.FGJ_Count = int.Parse(row["FGJ_Count"].ToString());
                    }
                    if (row["XSY_Count"].ToString() != "")
                    {
                        item.XSY_Count = int.Parse(row["XSY_Count"].ToString());
                    }
                    if (row["FXSY_Count"].ToString() != "")
                    {
                        item.FXSY_Count = int.Parse(row["FXSY_Count"].ToString());
                    }
                    if (row["DYY_Count"].ToString() != "")
                    {
                        item.DYY_Count = int.Parse(row["DYY_Count"].ToString());
                    }
                    if (row["FDYY_Count"].ToString() != "")
                    {
                        item.FDYY_Count = int.Parse(row["FDYY_Count"].ToString());
                    }
                    if (row["ZRKY_Count"].ToString() != "")
                    {
                        item.ZRKY_Count = int.Parse(row["ZRKY_Count"].ToString());
                    }
                    if (row["FZRKY_Count"].ToString() != "")
                    {
                        item.FZRKY_Count = int.Parse(row["FZRKY_Count"].ToString());
                    }
                    if (row["KY_Count"].ToString() != "")
                    {
                        item.KY_Count = int.Parse(row["KY_Count"].ToString());
                    }
                    if (row["OrganID"].ToString() != "")
                    {
                        item.OrganID = int.Parse(row["OrganID"].ToString());
                    }
                    if (row["BSY_Count"].ToString() != "")
                    {
                        item.BSY_Count = int.Parse(row["BSY_Count"].ToString());
                    }
                    if (row["BDJ_Count"].ToString() != "")
                    {
                        item.BDJ_Count = int.Parse(row["BDJ_Count"].ToString());
                    }
                    if (row["IsOffice"].ToString() != "")
                    {
                        item.IsOffice = int.Parse(row["IsOffice"].ToString());
                    }
                    if (row["Manager_Count"].ToString() != "")
                    {
                        item.Manager_Count = int.Parse(row["Manager_Count"].ToString());
                    }
                    if (row["M_3"].ToString() != "")
                    {
                        item.M_3 = int.Parse(row["M_3"].ToString());
                    }
                    if (row["M_4"].ToString() != "")
                    {
                        item.M_4 = int.Parse(row["M_4"].ToString());
                    }
                    if (row["M_5"].ToString() != "")
                    {
                        item.M_5 = int.Parse(row["M_5"].ToString());
                    }
                    if (row["M_6"].ToString() != "")
                    {
                        item.M_6 = int.Parse(row["M_6"].ToString());
                    }
                    if (row["M_7"].ToString() != "")
                    {
                        item.M_7 = int.Parse(row["M_7"].ToString());
                    }
                    if (row["M_8"].ToString() != "")
                    {
                        item.M_8 = int.Parse(row["M_8"].ToString());
                    }
                    if (row["UserBuild_Count"].ToString() != "")
                    {
                        item.UserBuild_Count = int.Parse(row["UserBuild_Count"].ToString());
                    }
                    if (row["M_9"].ToString() != "")
                    {
                        item.M_9 = int.Parse(row["M_9"].ToString());
                    }
                    if (row["M_10"].ToString() != "")
                    {
                        item.M_10 = int.Parse(row["M_10"].ToString());
                    }
                    if (row["Skiller_Count"].ToString() != "")
                    {
                        item.Skiller_Count = int.Parse(row["Skiller_Count"].ToString());
                    }
                    if (row["S_1"].ToString() != "")
                    {
                        item.S_1 = int.Parse(row["S_1"].ToString());
                    }
                    if (row["S_2"].ToString() != "")
                    {
                        item.S_2 = int.Parse(row["S_2"].ToString());
                    }
                    if (row["S_3"].ToString() != "")
                    {
                        item.S_3 = int.Parse(row["S_3"].ToString());
                    }
                    if (row["S_4"].ToString() != "")
                    {
                        item.S_4 = int.Parse(row["S_4"].ToString());
                    }
                    if (row["S_5"].ToString() != "")
                    {
                        item.S_5 = int.Parse(row["S_5"].ToString());
                    }
                    if (row["S_6"].ToString() != "")
                    {
                        item.S_6 = int.Parse(row["S_6"].ToString());
                    }
                    if (row["S_7"].ToString() != "")
                    {
                        item.S_7 = int.Parse(row["S_7"].ToString());
                    }
                    if (row["UserJobPostion_Count"].ToString() != "")
                    {
                        item.UserJobPostion_Count = int.Parse(row["UserJobPostion_Count"].ToString());
                    }
                    if (row["S_8"].ToString() != "")
                    {
                        item.S_8 = int.Parse(row["S_8"].ToString());
                    }
                    if (row["S_9"].ToString() != "")
                    {
                        item.S_9 = int.Parse(row["S_9"].ToString());
                    }
                    if (row["S_10"].ToString() != "")
                    {
                        item.S_10 = int.Parse(row["S_10"].ToString());
                    }
                    if (row["S_11"].ToString() != "")
                    {
                        item.S_11 = int.Parse(row["S_11"].ToString());
                    }
                    if (row["S_12"].ToString() != "")
                    {
                        item.S_12 = int.Parse(row["S_12"].ToString());
                    }
                    if (row["S_13"].ToString() != "")
                    {
                        item.S_13 = int.Parse(row["S_13"].ToString());
                    }
                    if (row["Worker_Count"].ToString() != "")
                    {
                        item.Worker_Count = int.Parse(row["Worker_Count"].ToString());
                    }
                    if (row["W_0"].ToString() != "")
                    {
                        item.W_0 = int.Parse(row["W_0"].ToString());
                    }
                    if (row["W_1"].ToString() != "")
                    {
                        item.W_1 = int.Parse(row["W_1"].ToString());
                    }
                    if (row["W_2"].ToString() != "")
                    {
                        item.W_2 = int.Parse(row["W_2"].ToString());
                    }
                    if (row["ZTJ_Count"].ToString() != "")
                    {
                        item.ZTJ_Count = int.Parse(row["ZTJ_Count"].ToString());
                    }
                    if (row["W_3"].ToString() != "")
                    {
                        item.W_3 = int.Parse(row["W_3"].ToString());
                    }
                    if (row["W_4"].ToString() != "")
                    {
                        item.W_4 = int.Parse(row["W_4"].ToString());
                    }
                    if (row["W_5"].ToString() != "")
                    {
                        item.W_5 = int.Parse(row["W_5"].ToString());
                    }
                    if (row["IsDoublePosition_Count"].ToString() != "")
                    {
                        item.IsDoublePosition_Count = int.Parse(row["IsDoublePosition_Count"].ToString());
                    }
                    item.No = row["No"].ToString();
                    item.Remark = row["Remark"].ToString();
                    if (row["FTJ_Count"].ToString() != "")
                    {
                        item.FTJ_Count = int.Parse(row["FTJ_Count"].ToString());
                    }
                    if (row["ZXJ_Count"].ToString() != "")
                    {
                        item.ZXJ_Count = int.Parse(row["ZXJ_Count"].ToString());
                    }
                    if (row["FXJ_Count"].ToString() != "")
                    {
                        item.FXJ_Count = int.Parse(row["FXJ_Count"].ToString());
                    }
                    if (row["ZKJ_Count"].ToString() != "")
                    {
                        item.ZKJ_Count = int.Parse(row["ZKJ_Count"].ToString());
                    }
                    list.Add(item);
                }
            }
            return list;
        }

        public OrganConfig GetModel(int organID)
        {
            StringBuilder builder = new StringBuilder();
            builder.Append("select * ");
            builder.Append("  from OrganConfig ");
            builder.Append(" where organID=@organID");
            SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@organID", SqlDbType.Int, 4) };
            cmdParms[0].Value = organID;
            OrganConfig config = new OrganConfig();
            DataSet set = DBHelper.Query(builder.ToString(), cmdParms);
            if (set.Tables[0].Rows.Count > 0)
            {
                DataRow row = set.Tables[0].Rows[0];
                if (row["ConfigID"].ToString() != "")
                {
                    config.ConfigID = int.Parse(row["ConfigID"].ToString());
                }
                if (row["FKJ_Count"].ToString() != "")
                {
                    config.FKJ_Count = int.Parse(row["FKJ_Count"].ToString());
                }
                if (row["ZGJ_Count"].ToString() != "")
                {
                    config.ZGJ_Count = int.Parse(row["ZGJ_Count"].ToString());
                }
                if (row["FGJ_Count"].ToString() != "")
                {
                    config.FGJ_Count = int.Parse(row["FGJ_Count"].ToString());
                }
                if (row["XSY_Count"].ToString() != "")
                {
                    config.XSY_Count = int.Parse(row["XSY_Count"].ToString());
                }
                if (row["FXSY_Count"].ToString() != "")
                {
                    config.FXSY_Count = int.Parse(row["FXSY_Count"].ToString());
                }
                if (row["DYY_Count"].ToString() != "")
                {
                    config.DYY_Count = int.Parse(row["DYY_Count"].ToString());
                }
                if (row["FDYY_Count"].ToString() != "")
                {
                    config.FDYY_Count = int.Parse(row["FDYY_Count"].ToString());
                }
                if (row["ZRKY_Count"].ToString() != "")
                {
                    config.ZRKY_Count = int.Parse(row["ZRKY_Count"].ToString());
                }
                if (row["FZRKY_Count"].ToString() != "")
                {
                    config.FZRKY_Count = int.Parse(row["FZRKY_Count"].ToString());
                }
                if (row["KY_Count"].ToString() != "")
                {
                    config.KY_Count = int.Parse(row["KY_Count"].ToString());
                }
                if (row["OrganID"].ToString() != "")
                {
                    config.OrganID = int.Parse(row["OrganID"].ToString());
                }
                if (row["BSY_Count"].ToString() != "")
                {
                    config.BSY_Count = int.Parse(row["BSY_Count"].ToString());
                }
                if (row["BDJ_Count"].ToString() != "")
                {
                    config.BDJ_Count = int.Parse(row["BDJ_Count"].ToString());
                }
                if (row["IsOffice"].ToString() != "")
                {
                    config.IsOffice = int.Parse(row["IsOffice"].ToString());
                }
                if (row["Manager_Count"].ToString() != "")
                {
                    config.Manager_Count = int.Parse(row["Manager_Count"].ToString());
                }
                if (row["M_3"].ToString() != "")
                {
                    config.M_3 = int.Parse(row["M_3"].ToString());
                }
                if (row["M_4"].ToString() != "")
                {
                    config.M_4 = int.Parse(row["M_4"].ToString());
                }
                if (row["M_5"].ToString() != "")
                {
                    config.M_5 = int.Parse(row["M_5"].ToString());
                }
                if (row["M_6"].ToString() != "")
                {
                    config.M_6 = int.Parse(row["M_6"].ToString());
                }
                if (row["M_7"].ToString() != "")
                {
                    config.M_7 = int.Parse(row["M_7"].ToString());
                }
                if (row["M_8"].ToString() != "")
                {
                    config.M_8 = int.Parse(row["M_8"].ToString());
                }
                if (row["UserBuild_Count"].ToString() != "")
                {
                    config.UserBuild_Count = int.Parse(row["UserBuild_Count"].ToString());
                }
                if (row["M_9"].ToString() != "")
                {
                    config.M_9 = int.Parse(row["M_9"].ToString());
                }
                if (row["M_10"].ToString() != "")
                {
                    config.M_10 = int.Parse(row["M_10"].ToString());
                }
                if (row["Skiller_Count"].ToString() != "")
                {
                    config.Skiller_Count = int.Parse(row["Skiller_Count"].ToString());
                }
                if (row["S_1"].ToString() != "")
                {
                    config.S_1 = int.Parse(row["S_1"].ToString());
                }
                if (row["S_2"].ToString() != "")
                {
                    config.S_2 = int.Parse(row["S_2"].ToString());
                }
                if (row["S_3"].ToString() != "")
                {
                    config.S_3 = int.Parse(row["S_3"].ToString());
                }
                if (row["S_4"].ToString() != "")
                {
                    config.S_4 = int.Parse(row["S_4"].ToString());
                }
                if (row["S_5"].ToString() != "")
                {
                    config.S_5 = int.Parse(row["S_5"].ToString());
                }
                if (row["S_6"].ToString() != "")
                {
                    config.S_6 = int.Parse(row["S_6"].ToString());
                }
                if (row["S_7"].ToString() != "")
                {
                    config.S_7 = int.Parse(row["S_7"].ToString());
                }
                if (row["UserJobPostion_Count"].ToString() != "")
                {
                    config.UserJobPostion_Count = int.Parse(row["UserJobPostion_Count"].ToString());
                }
                if (row["S_8"].ToString() != "")
                {
                    config.S_8 = int.Parse(row["S_8"].ToString());
                }
                if (row["S_9"].ToString() != "")
                {
                    config.S_9 = int.Parse(row["S_9"].ToString());
                }
                if (row["S_10"].ToString() != "")
                {
                    config.S_10 = int.Parse(row["S_10"].ToString());
                }
                if (row["S_11"].ToString() != "")
                {
                    config.S_11 = int.Parse(row["S_11"].ToString());
                }
                if (row["S_12"].ToString() != "")
                {
                    config.S_12 = int.Parse(row["S_12"].ToString());
                }
                if (row["S_13"].ToString() != "")
                {
                    config.S_13 = int.Parse(row["S_13"].ToString());
                }
                if (row["Worker_Count"].ToString() != "")
                {
                    config.Worker_Count = int.Parse(row["Worker_Count"].ToString());
                }
                if (row["W_0"].ToString() != "")
                {
                    config.W_0 = int.Parse(row["W_0"].ToString());
                }
                if (row["W_1"].ToString() != "")
                {
                    config.W_1 = int.Parse(row["W_1"].ToString());
                }
                if (row["W_2"].ToString() != "")
                {
                    config.W_2 = int.Parse(row["W_2"].ToString());
                }
                if (row["ZTJ_Count"].ToString() != "")
                {
                    config.ZTJ_Count = int.Parse(row["ZTJ_Count"].ToString());
                }
                if (row["W_3"].ToString() != "")
                {
                    config.W_3 = int.Parse(row["W_3"].ToString());
                }
                if (row["W_4"].ToString() != "")
                {
                    config.W_4 = int.Parse(row["W_4"].ToString());
                }
                if (row["W_5"].ToString() != "")
                {
                    config.W_5 = int.Parse(row["W_5"].ToString());
                }
                if (row["IsDoublePosition_Count"].ToString() != "")
                {
                    config.IsDoublePosition_Count = int.Parse(row["IsDoublePosition_Count"].ToString());
                }
                config.No = row["No"].ToString();
                config.Remark = row["Remark"].ToString();
                if (row["FTJ_Count"].ToString() != "")
                {
                    config.FTJ_Count = int.Parse(row["FTJ_Count"].ToString());
                }
                if (row["ZXJ_Count"].ToString() != "")
                {
                    config.ZXJ_Count = int.Parse(row["ZXJ_Count"].ToString());
                }
                if (row["FXJ_Count"].ToString() != "")
                {
                    config.FXJ_Count = int.Parse(row["FXJ_Count"].ToString());
                }
                if (row["ZKJ_Count"].ToString() != "")
                {
                    config.ZKJ_Count = int.Parse(row["ZKJ_Count"].ToString());
                }
                return config;
            }
            return null;
        }

        public bool Update(OrganConfig model)
        {
            StringBuilder builder = new StringBuilder();
            builder.Append("update OrganConfig set ");
            builder.Append(" FKJ_Count = @FKJ_Count , ");
            builder.Append(" ZGJ_Count = @ZGJ_Count , ");
            builder.Append(" FGJ_Count = @FGJ_Count , ");
            builder.Append(" XSY_Count = @XSY_Count , ");
            builder.Append(" FXSY_Count = @FXSY_Count , ");
            builder.Append(" DYY_Count = @DYY_Count , ");
            builder.Append(" FDYY_Count = @FDYY_Count , ");
            builder.Append(" ZRKY_Count = @ZRKY_Count , ");
            builder.Append(" FZRKY_Count = @FZRKY_Count , ");
            builder.Append(" KY_Count = @KY_Count , ");
            builder.Append(" OrganID = @OrganID , ");
            builder.Append(" BSY_Count = @BSY_Count , ");
            builder.Append(" BDJ_Count = @BDJ_Count , ");
            builder.Append(" IsOffice = @IsOffice , ");
            builder.Append(" Manager_Count = @Manager_Count , ");
            builder.Append(" M_3 = @M_3 , ");
            builder.Append(" M_4 = @M_4 , ");
            builder.Append(" M_5 = @M_5 , ");
            builder.Append(" M_6 = @M_6 , ");
            builder.Append(" M_7 = @M_7 , ");
            builder.Append(" M_8 = @M_8 , ");
            builder.Append(" UserBuild_Count = @UserBuild_Count , ");
            builder.Append(" M_9 = @M_9 , ");
            builder.Append(" M_10 = @M_10 , ");
            builder.Append(" Skiller_Count = @Skiller_Count , ");
            builder.Append(" S_1 = @S_1 , ");
            builder.Append(" S_2 = @S_2 , ");
            builder.Append(" S_3 = @S_3 , ");
            builder.Append(" S_4 = @S_4 , ");
            builder.Append(" S_5 = @S_5 , ");
            builder.Append(" S_6 = @S_6 , ");
            builder.Append(" S_7 = @S_7 , ");
            builder.Append(" UserJobPostion_Count = @UserJobPostion_Count , ");
            builder.Append(" S_8 = @S_8 , ");
            builder.Append(" S_9 = @S_9 , ");
            builder.Append(" S_10 = @S_10 , ");
            builder.Append(" S_11 = @S_11 , ");
            builder.Append(" S_12 = @S_12 , ");
            builder.Append(" S_13 = @S_13 , ");
            builder.Append(" Worker_Count = @Worker_Count , ");
            builder.Append(" W_0 = @W_0 , ");
            builder.Append(" W_1 = @W_1 , ");
            builder.Append(" W_2 = @W_2 , ");
            builder.Append(" ZTJ_Count = @ZTJ_Count , ");
            builder.Append(" W_3 = @W_3 , ");
            builder.Append(" W_4 = @W_4 , ");
            builder.Append(" W_5 = @W_5 , ");
            builder.Append(" IsDoublePosition_Count = @IsDoublePosition_Count , ");
            builder.Append(" No = @No , ");
            builder.Append(" Remark = @Remark , ");
            builder.Append(" FTJ_Count = @FTJ_Count , ");
            builder.Append(" ZXJ_Count = @ZXJ_Count , ");
            builder.Append(" FXJ_Count = @FXJ_Count , ");
            builder.Append(" ZKJ_Count = @ZKJ_Count  ");
            builder.Append(" where ConfigID=@ConfigID ");
            SqlParameter[] cmdParms = new SqlParameter[] { 
                new SqlParameter("@ConfigID", model.ConfigID), new SqlParameter("@FKJ_Count", model.FKJ_Count), new SqlParameter("@ZGJ_Count", model.ZGJ_Count), new SqlParameter("@FGJ_Count", model.FGJ_Count), new SqlParameter("@XSY_Count", model.XSY_Count), new SqlParameter("@FXSY_Count", model.FXSY_Count), new SqlParameter("@DYY_Count", model.DYY_Count), new SqlParameter("@FDYY_Count", model.FDYY_Count), new SqlParameter("@ZRKY_Count", model.ZRKY_Count), new SqlParameter("@FZRKY_Count", model.FZRKY_Count), new SqlParameter("@KY_Count", model.KY_Count), new SqlParameter("@OrganID", model.OrganID), new SqlParameter("@BSY_Count", model.BSY_Count), new SqlParameter("@BDJ_Count", model.BDJ_Count), new SqlParameter("@IsOffice", model.IsOffice), new SqlParameter("@Manager_Count", model.Manager_Count), 
                new SqlParameter("@M_3", model.M_3), new SqlParameter("@M_4", model.M_4), new SqlParameter("@M_5", model.M_5), new SqlParameter("@M_6", model.M_6), new SqlParameter("@M_7", model.M_7), new SqlParameter("@M_8", model.M_8), new SqlParameter("@UserBuild_Count", model.UserBuild_Count), new SqlParameter("@M_9", model.M_9), new SqlParameter("@M_10", model.M_10), new SqlParameter("@Skiller_Count", model.Skiller_Count), new SqlParameter("@S_1", model.S_1), new SqlParameter("@S_2", model.S_2), new SqlParameter("@S_3", model.S_3), new SqlParameter("@S_4", model.S_4), new SqlParameter("@S_5", model.S_5), new SqlParameter("@S_6", model.S_6), 
                new SqlParameter("@S_7", model.S_7), new SqlParameter("@UserJobPostion_Count", model.UserJobPostion_Count), new SqlParameter("@S_8", model.S_8), new SqlParameter("@S_9", model.S_9), new SqlParameter("@S_10", model.S_10), new SqlParameter("@S_11", model.S_11), new SqlParameter("@S_12", model.S_12), new SqlParameter("@S_13", model.S_13), new SqlParameter("@Worker_Count", model.Worker_Count), new SqlParameter("@W_0", model.W_0), new SqlParameter("@W_1", model.W_1), new SqlParameter("@W_2", model.W_2), new SqlParameter("@ZTJ_Count", model.ZTJ_Count), new SqlParameter("@W_3", model.W_3), new SqlParameter("@W_4", model.W_4), new SqlParameter("@W_5", model.W_5), 
                new SqlParameter("@IsDoublePosition_Count", model.IsDoublePosition_Count), new SqlParameter("@No", model.No), new SqlParameter("@Remark", model.Remark), new SqlParameter("@FTJ_Count", model.FTJ_Count), new SqlParameter("@ZXJ_Count", model.ZXJ_Count), new SqlParameter("@FXJ_Count", model.FXJ_Count), new SqlParameter("@ZKJ_Count", model.ZKJ_Count)
             };
            return (DBHelper.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
    }
}

